Main Menu

Recent posts

#21
Tiko Programming Language / Re: Editor Questions
Last post by Marc Giao - November 30, 2026, 08:49:09 PM
Thanks Jose for the code and the links, I'd already visited most but I was just missing the magic ingredient " #cmdline "-s gui" ". I want to explore Tiko without using forms, I have always coded without forms.
#22
Tiko Programming Language / Re: Editor Questions
Last post by Marc Giao - November 30, 2026, 08:42:52 PM
Quote from: Johan Klassen on November 30, 2026, 08:27:10 PMMarc Giao
running your program from tkedit will launch a terminal even with #cmdline "-s gui"
but if you compile your program with tkedit using #cmdline "-s gui" and then launch your program by double-clicking then you should see no terminal


Thanks Johan,

You are correct, #cmdline "-s gui" does indeed resolve the issue! I was running all my examples from the editor, double clicking the exe opens the window without the console window.

Amazing what you can do when know waht you're doing :)
#24
Tiko Programming Language / Re: Editor Questions
Last post by Paul Squires - November 30, 2026, 08:29:24 PM
You guys are correct. Trying to set your file/project to GUI only is needlessly complex.

And to confuse matters more, setting -s gui via #cmdline can be overridden by other project or build settings.

I will work on this tonight to simplify the whole thing.
#25
Tiko Programming Language / Re: Editor Questions
Last post by José Roca - November 30, 2026, 08:27:57 PM
There are also examples that use dialogs (in the folder examples/win64/CDialog), e.g.

' ########################################################################################
' Microsoft Windows
' Contents: Windows controls - Button with a tooltip
' Compiler: tiko-lang
' Copyright (c) 2026 José Roca. Freeware. Use at your own risk.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################

#import "sys/win"
#import "sys/win/gui"
using win, gui

' // Forward declaration
DECLARE FUNCTION DlgProc (BYVAL hDlg AS HWND, BYVAL uMsg AS DWORD, BYVAL wParam AS DWORD, BYVAL lParam AS LPARAM) AS INT_PTR

CONST IDC_OK = 1001

' ========================================================================================
' Main
' ========================================================================================
FUNCTION main (BYVAL nCmdShow AS LONG = SW_SHOW) AS LONG

   ' // Set process DPI aware
   SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE)
   ' // Enable visual styles without including a manifest file
   EnableVisualStyles

   ' // Create a new dialog using dialog units
   DIM pDlg AS CDialog
   pDlg.DialogNew(0, "Cialog with a button and tooltip", 50, 50, 175, 65, WS_OVERLAPPEDWINDOW OR DS_CENTER)

   ' // Add a button to the dialog
   DIM hButton AS HWND = pDlg.ControlAdd("Button", IDC_OK, "&Hover me", 105, 40, 50, 12, BS_DEFPUSHBUTTON)

   ' // Add a tooltip to the button
   DIM hTooltip AS HWND = ToolTip.AddTooltip(hButton, "This is a button with a tooltip", TRUE, TRUE)
   ' // Add a caption and an icon to the tooltip
   ToolTip.SetTitle(hTooltip, TTI_INFO, "Caption")

   ' // Anchor the button to the bottom and the right side of the dialog
   pDlg.ControlAnchor(IDC_OK, ANCHOR_BOTTOM_RIGHT)

   ' // Display and activate the dialog as modal
   pDlg.DialogShowModal(@DlgProc)

   RETURN pDlg.DialogEndResult

END FUNCTION
' ========================================================================================

' ========================================================================================
' Dialog callback procedure
' ========================================================================================
FUNCTION DlgProc (BYVAL hDlg AS HWND, BYVAL uMsg AS DWORD, BYVAL wParam AS DWORD, BYVAL lParam AS LPARAM) AS INT_PTR

   ' // Pointer to the dialog class
   STATIC pDlg AS CDialog PTR
  
   SELECT CASE uMsg

      CASE WM_INITDIALOG
         ' // Get a pointer to the CDialog class
         pDlg = cast(CDialog PTR, lParam)
         RETURN TRUE

      CASE WM_COMMAND
         SELECT CASE CBCTL(wParam, lParam)
            CASE IDCANCEL
               ' // If ESC key pressed, close the application by sending an WM_CLOSE message
               IF CBCTLMSG(wParam, lParam) = BN_CLICKED THEN
                  pDlg->DialogSend(WM_CLOSE, 0, 0)
               END IF
            CASE IDC_OK
               MessageBoxW(hDlg, "OK button pressed", "Message", MB_OK)
         END SELECT

      CASE WM_CLOSE
         ' // End the application
         pDlg->DialogEnd(0)

   END SELECT

   RETURN FALSE

END FUNCTION
' ========================================================================================

' ========================================================================================
' // Call main() and return the error code to the OS
' ========================================================================================
END main()
' ========================================================================================
#26
Tiko Programming Language / Re: Editor Questions
Last post by Johan Klassen - November 30, 2026, 08:27:10 PM
Marc Giao
running your program from tkedit will launch a terminal even with #cmdline "-s gui"
but if you compile your program with tkedit using #cmdline "-s gui" and then launch your program by double-clicking then you should see no terminal
#27
Tiko Programming Language / Re: Editor Questions
Last post by José Roca - November 30, 2026, 08:22:18 PM
> At my current point on the Tiko learning curve I just need the bare minimum windows example.

If you want Windows only programs, then look at the folder examples/win64.

In the folder examples/win64/Windows Controls Examples you will find examples like this one:

' ########################################################################################
' Microsoft Windows
' Contents: ListBox control
' Compiler: tiko-lang
' Copyright (c) 2026 José Roca. Freeware. Use at your own risk.
' THIS CODE AND INFORMATION IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER
' EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE IMPLIED WARRANTIES OF
' MERCHANTABILITY AND/OR FITNESS FOR A PARTICULAR PURPOSE.
' ########################################################################################

#import "sys/win"
#import "sys/win/gui"
using win, gui

' // Forward declaration
DECLARE FUNCTION WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT

#define IDC_LISTBOX 1001

' ========================================================================================
' Main
' ========================================================================================
FUNCTION main (BYVAL nCmdShow AS LONG = SW_NORMAL) AS LONG

   ' // Set process DPI aware
   SetProcessDpiAwareness(PROCESS_SYSTEM_DPI_AWARE)
   ' // Enable visual styles without including a manifest file
   EnableVisualStyles

   ' // Create the main window
   DIM pWindow AS CWindow = "MyClassName"   ' Use the name you wish
   DIM hWin AS HWND = pWindow.Create(NULL, "CWindow - ListBox control", @WndProc)
   ' // Size it by setting the wanted width and height of its client area
   pWindow.SetClientSize(318, 380)
   ' // Center the window
   pWindow.Center

   ' // Adds a listbox
   DIM hListBox AS HWND = pWindow.AddControl("ListBox", hWin, IDC_LISTBOX)
   pWindow.SetWindowPos hListBox, NULL, 8, 8, 300, 320, SWP_NOZORDER
   ' // Anchor the ListBox
   pWindow.AnchorControl(hListBox, ANCHOR_HEIGHT_WIDTH)

   ' // Fill the list box
   DIM ustrText AS USTRING
   FOR i AS LONG = 1 TO 50
      ustrText = "Item " & RIGHT("00" & WSTR(i), 2)
      ListBox.AddString(hListBox, ustrText)
   NEXT
   ' // Select the first item
   ListBox.SetCursel(hListBox, 0)

   ' // Add a cancel button
   pWindow.AddControl("Button", hWin, IDCANCEL, "&Cancel",  233, 340, 75, 23)
   ' // Anchor the button
   pWindow.AnchorControl(IDCANCEL, ANCHOR_BOTTOM_RIGHT)

   ' // Displays the window and dispatches the Windows messages
   FUNCTION = pWindow.DoEvents(nCmdShow)

END FUNCTION
' ========================================================================================

' ========================================================================================
' Main window procedure
' ========================================================================================
FUNCTION WndProc (BYVAL hwnd AS HWND, BYVAL uMsg AS UINT, BYVAL wParam AS WPARAM, BYVAL lParam AS LPARAM) AS LRESULT

   SELECT CASE uMsg

      ' // If an application processes this message, it should return zero to continue
      ' // creation of the window. If the application returns –1, the window is destroyed
      ' // and the CreateWindowExW function returns a NULL handle.
      CASE WM_CREATE
         EnableDarkModeForWindow(hwnd)
         RETURN 0

      ' // Theme has changed
      CASE WM_THEMECHANGED
         EnableDarkModeForWindow(hwnd)
         RETURN 0

      ' // Sent when the user selects a command item from a menu, when a control sends a
      ' // notification message to its parent window, or when an accelerator keystroke is translated.
      CASE WM_COMMAND
         SELECT CASE CBCTL(wParam, lParam)
            CASE IDCANCEL
               ' // If ESC key pressed, close the application by sending an WM_CLOSE message
               IF CBCTLMSG(wParam, lParam) = BN_CLICKED THEN SendMessageW(hwnd, WM_CLOSE, 0, 0)
            CASE IDC_LISTBOX
               SELECT CASE CBCTLMSG(wParam, lParam)
                  CASE LBN_DBLCLK
                     ' // Get the handle of the Listbox
                     DIM hListBox AS HWND = GetDlgItem(hwnd, IDC_LISTBOX)
                     ' // Get the current selection
                     DIM curSel AS LONG = ListBox.GetCursel(hListBox)
                     DIM ustrText AS USTRING = ListBox.GetText(hListBox, curSel)
                     MessageBoxW(hwnd, ustrText, "ListBox test", MB_OK)
               END SELECT
         END SELECT
         RETURN 0

      CASE WM_DESTROY
         ' // End the application by sending an WM_QUIT message
         PostQuitMessage(0)
         RETURN 0

   END SELECT

   ' // Default processing of Windows messages
   FUNCTION = DefWindowProcW(hwnd, uMsg, wParam, lParam)

END FUNCTION
' ========================================================================================

' ========================================================================================
' // Call main() and return the error code to the OS
' ========================================================================================
END main()
' ========================================================================================
#28
Tiko Programming Language / Re: Editor Questions
Last post by Marc Giao - November 30, 2026, 07:34:56 PM
Hi,

Using "tiko programming language" same issue, coming from PB, I need a Tiko for Dummies book!

I've tried adding " #cmdline "-s gui" " but still get the console.

There is no shortage of documentation and examples but I haven't found a minimal windows example that just opens a window so I can then add more controls. I don't want to use forms at this point it would just confuse my old brain even more.

The documentation and examples are fantastic but I am finding it a little overwhelming. At my current point on the Tiko learning curve I just need the bare minimum windows example.

But I keep experimenting... :)
#29
Tiko Programming Language / Re: Editor Questions
Last post by Paul Squires - November 30, 2026, 06:51:16 PM
FYI: The older Tiko Editor that was built for traditional FreeBASIC does NOT work with tiko programming language
#30
Tiko Programming Language / Re: Editor Questions
Last post by Paul Squires - November 30, 2026, 06:50:06 PM
QuoteI have just posted a query about getting rid of the Console Window, before finding this post.  Where do I find the Win64 GUI Configuration?
Which application are you using? The older Tiko Editor that was built for traditional FreeBASIC, or the new tkEdit Editor included in the Tiko Programming Language?