Load available printers to a combobox
Posted
#1
(In Topic #1340)
Regular

Ok i'd like to populate a combobox with a list of available printers.
I'm aware lpstat -a in a konsole yields the result I'm after but I can't figure out how to apply that to Gambas!
Anyone able to help me out…….. again!
Posted
Regular

Individuare le stampanti presenti nel proprio sistema - Gambas-it.org - Wikipedia
Europaeus sum !
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
<COLOR color="#FF8000">Amare memorentes atque deflentes ad mortem silenter labimur.</COLOR>
Posted
Administrator

The Print instruction can be replaced by placing it in for example a ListView.
You can further refine the output by searching each sLine for the position of the text 'accepting' and use some String functions to cut of the line and have just printer name remaining. Look for functions like Instr() to determine position and Left() etc. to remove the unwanted text.
Enjoy
gbWilly
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
- Gambas Dutch translator
- Gambas wiki content contributor
- Gambas debian/ubuntu package recipe contributor
- GambOS, a distro for learning Gambas and more…
- Gambas3 Debian/Ubuntu repositories
… there is always a Catch if things go wrong!
Posted
Guru

Code (gambas)
- ComboBox1.List = sPrinters 'Add the Printers to the ComboBox
- ComboBox1.Text = sDefault 'Display the Default Printer
Posted
Guru

Code (gambas)
Posted
Regular

1 guest and 0 members have just viewed this.

